//
//  WEXComposeMenuButton.swift
//  microBlog
//
//  Created by apple on 16/4/25.
//  Copyright © 2016年 Hill. All rights reserved.
//

import UIKit

class WEXComposeMenuButton: UIButton {
    
    
//    重写button的highlighted状态
    override var highlighted: Bool  {
        
        get{
            
          return false
        }
        
        set{
            
            
        }
        
    }

    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        
        titleLabel?.textAlignment = .Center
        
        imageView?.contentMode = .Center
        
    }
    
    // MARK: - 重写子控件布局
    override func layoutSubviews() {
        super.layoutSubviews()
        
//        按钮的图片的布局
        self.imageView?.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.width)
//        按钮文本的布局
        self.titleLabel?.frame = CGRect(x: 0, y: self.frame.width , width: self.frame.width, height: self.frame.height - self.frame.width)
        
    }
    
    

}
